package br.com.veterinariavillage.control;

import java.util.ArrayList;

import br.com.veterinariavillage.dao.DAOAnimal;
import br.com.veterinariavillage.dao.IDAOAnimal;
import br.com.veterinariavillage.dao.IDAOBuscaAnimal;
import br.com.veterinariavillage.model.Animal;

public class CtrAnimal {

	public void inserirAnimal(Animal a) {
		IDAOAnimal dao = new DAOAnimal();
		dao.inserir(a);
	}
	public void alterarAnimal(Animal a) {
		IDAOAnimal dao = new DAOAnimal();
		dao.atualizar(a);		
	}
	public void excluirAnimal(Animal a) {
		IDAOAnimal dao = new DAOAnimal();
		dao.excluir(a);		
	}
	public static CtrAnimal getControle(){
		return new CtrAnimal();
	}
	public ArrayList<Animal> consultarAnimal(){
		IDAOBuscaAnimal dao = new DAOAnimal();
		return dao.localizar();	
	}
	public ArrayList<Animal> consultarAnimal(String nome){
		IDAOBuscaAnimal dao = new DAOAnimal();
		return dao.localizar(nome);	
	}
}
